package com.invengo.library_db.entity.module_check;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Transient;

import java.io.Serializable;

@Entity
public class ShelfBean implements Serializable, Parcelable, Cloneable {
    /**
     * Serializable
     */
    private static final long serialVersionUID = 1L;

    @Index
    private String columName;//完整建筑楼层房间名称
    private int ShelfNo;
    public int BuildNo;
    public int FloorNo;
    public int RoomNo;
    public String BuildingName;
    public String FloorName;
    public String RoomName;



    @Id(autoincrement = true)
    public Long Id;

    //    @ToMany(joinProperties = {@JoinProperty(name = "shelfCode", referencedName = "shelfCode")})
//    private List<BookBean> bookBeans;
    @Index
    @Expose
    @SerializedName("nBookCaseID")
    private String tid;
    // 架位编码
    @Index
    @Expose
    @SerializedName("szBookCaseNo")
    private String shelfCode;
    @SerializedName("szCaseNoTrans")
    @Expose
    private String shelfName;
    @SerializedName("nLayer")
    @Expose
    private int layer;
    @SerializedName("nBookCount")
    @Expose
    private int bookCount;
    @SerializedName("szFirstBookID")
    @Expose
    private String firstBookID;
    @SerializedName("szFirstBookName")
    @Expose
    private String firstBookName;
    @SerializedName("szFirstBookLibCD")
    @Expose
    private String firstBookLibCD;
    //首书索书号
    @SerializedName("szBookIndex")
    @Expose
    private String bookIndex;
    @Index
    @SerializedName("szPretendIndexNum")
    @Expose
    private String pretendIndexNum;
    @SerializedName("szlibCD")
    @Expose
    private String libCD;


    private String szLyrBarCode;
    @Transient
    private String nEPCOrder;
    @Transient
    private String dtLastOrderCase;
    @Transient
    private String dtLastMatchCase;
    @Transient
    private String dtLastUpdate;
    @Transient
    private String nOnNum;
    @Transient
    private String nWrongNum;
    @Transient
    private int nOrder;
    @Override
    public ShelfBean clone() throws CloneNotSupportedException {
        return (ShelfBean) super.clone();
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.columName);
        dest.writeInt(this.ShelfNo);
        dest.writeInt(this.BuildNo);
        dest.writeInt(this.FloorNo);
        dest.writeInt(this.RoomNo);
        dest.writeString(this.BuildingName);
        dest.writeString(this.FloorName);
        dest.writeString(this.RoomName);
        dest.writeValue(this.Id);
        dest.writeString(this.tid);
        dest.writeString(this.shelfCode);
        dest.writeString(this.shelfName);
        dest.writeInt(this.layer);
        dest.writeInt(this.bookCount);
        dest.writeString(this.firstBookID);
        dest.writeString(this.firstBookName);
        dest.writeString(this.firstBookLibCD);
        dest.writeString(this.bookIndex);
        dest.writeString(this.pretendIndexNum);
        dest.writeString(this.libCD);
        dest.writeString(this.szLyrBarCode);
        dest.writeString(this.nEPCOrder);
        dest.writeString(this.dtLastOrderCase);
        dest.writeString(this.dtLastMatchCase);
        dest.writeString(this.dtLastUpdate);
        dest.writeString(this.nOnNum);
        dest.writeString(this.nWrongNum);
        dest.writeInt(this.nOrder);
    }

    public void readFromParcel(Parcel source) {
        this.columName = source.readString();
        this.ShelfNo = source.readInt();
        this.BuildNo = source.readInt();
        this.FloorNo = source.readInt();
        this.RoomNo = source.readInt();
        this.BuildingName = source.readString();
        this.FloorName = source.readString();
        this.RoomName = source.readString();
        this.Id = (Long) source.readValue(Long.class.getClassLoader());
        this.tid = source.readString();
        this.shelfCode = source.readString();
        this.shelfName = source.readString();
        this.layer = source.readInt();
        this.bookCount = source.readInt();
        this.firstBookID = source.readString();
        this.firstBookName = source.readString();
        this.firstBookLibCD = source.readString();
        this.bookIndex = source.readString();
        this.pretendIndexNum = source.readString();
        this.libCD = source.readString();
        this.szLyrBarCode = source.readString();
        this.nEPCOrder = source.readString();
        this.dtLastOrderCase = source.readString();
        this.dtLastMatchCase = source.readString();
        this.dtLastUpdate = source.readString();
        this.nOnNum = source.readString();
        this.nWrongNum = source.readString();
        this.nOrder = source.readInt();
    }


    public String getColumName() {
        return this.columName;
    }


    public void setColumName(String columName) {
        this.columName = columName;
    }


    public int getShelfNo() {
        return this.ShelfNo;
    }


    public void setShelfNo(int ShelfNo) {
        this.ShelfNo = ShelfNo;
    }


    public int getBuildNo() {
        return this.BuildNo;
    }


    public void setBuildNo(int BuildNo) {
        this.BuildNo = BuildNo;
    }


    public int getFloorNo() {
        return this.FloorNo;
    }


    public void setFloorNo(int FloorNo) {
        this.FloorNo = FloorNo;
    }


    public int getRoomNo() {
        return this.RoomNo;
    }


    public void setRoomNo(int RoomNo) {
        this.RoomNo = RoomNo;
    }


    public String getBuildingName() {
        return this.BuildingName;
    }


    public void setBuildingName(String BuildingName) {
        this.BuildingName = BuildingName;
    }


    public String getFloorName() {
        return this.FloorName;
    }


    public void setFloorName(String FloorName) {
        this.FloorName = FloorName;
    }


    public String getRoomName() {
        return this.RoomName;
    }


    public void setRoomName(String RoomName) {
        this.RoomName = RoomName;
    }


    public Long getId() {
        return this.Id;
    }


    public void setId(Long Id) {
        this.Id = Id;
    }


    public String getTid() {
        return this.tid;
    }


    public void setTid(String tid) {
        this.tid = tid;
    }


    public String getShelfCode() {
        return this.shelfCode;
    }


    public void setShelfCode(String shelfCode) {
        this.shelfCode = shelfCode;
    }


    public String getShelfName() {
        return this.shelfName;
    }


    public void setShelfName(String shelfName) {
        this.shelfName = shelfName;
    }


    public int getLayer() {
        return this.layer;
    }


    public void setLayer(int layer) {
        this.layer = layer;
    }


    public int getBookCount() {
        return this.bookCount;
    }


    public void setBookCount(int bookCount) {
        this.bookCount = bookCount;
    }


    public String getFirstBookID() {
        return this.firstBookID;
    }


    public void setFirstBookID(String firstBookID) {
        this.firstBookID = firstBookID;
    }


    public String getFirstBookName() {
        return this.firstBookName;
    }


    public void setFirstBookName(String firstBookName) {
        this.firstBookName = firstBookName;
    }


    public String getFirstBookLibCD() {
        return this.firstBookLibCD;
    }


    public void setFirstBookLibCD(String firstBookLibCD) {
        this.firstBookLibCD = firstBookLibCD;
    }


    public String getBookIndex() {
        return this.bookIndex;
    }


    public void setBookIndex(String bookIndex) {
        this.bookIndex = bookIndex;
    }


    public String getPretendIndexNum() {
        return this.pretendIndexNum;
    }


    public void setPretendIndexNum(String pretendIndexNum) {
        this.pretendIndexNum = pretendIndexNum;
    }


    public String getLibCD() {
        return this.libCD;
    }


    public void setLibCD(String libCD) {
        this.libCD = libCD;
    }


    public String getSzLyrBarCode() {
        return this.szLyrBarCode;
    }


    public void setSzLyrBarCode(String szLyrBarCode) {
        this.szLyrBarCode = szLyrBarCode;
    }

    public ShelfBean() {
    }

    protected ShelfBean(Parcel in) {
        this.columName = in.readString();
        this.ShelfNo = in.readInt();
        this.BuildNo = in.readInt();
        this.FloorNo = in.readInt();
        this.RoomNo = in.readInt();
        this.BuildingName = in.readString();
        this.FloorName = in.readString();
        this.RoomName = in.readString();
        this.Id = (Long) in.readValue(Long.class.getClassLoader());
        this.tid = in.readString();
        this.shelfCode = in.readString();
        this.shelfName = in.readString();
        this.layer = in.readInt();
        this.bookCount = in.readInt();
        this.firstBookID = in.readString();
        this.firstBookName = in.readString();
        this.firstBookLibCD = in.readString();
        this.bookIndex = in.readString();
        this.pretendIndexNum = in.readString();
        this.libCD = in.readString();
        this.szLyrBarCode = in.readString();
        this.nEPCOrder = in.readString();
        this.dtLastOrderCase = in.readString();
        this.dtLastMatchCase = in.readString();
        this.dtLastUpdate = in.readString();
        this.nOnNum = in.readString();
        this.nWrongNum = in.readString();
        this.nOrder = in.readInt();
    }


    @Generated(hash = 1351596656)
    public ShelfBean(String columName, int ShelfNo, int BuildNo, int FloorNo, int RoomNo,
            String BuildingName, String FloorName, String RoomName, Long Id, String tid,
            String shelfCode, String shelfName, int layer, int bookCount, String firstBookID,
            String firstBookName, String firstBookLibCD, String bookIndex, String pretendIndexNum,
            String libCD, String szLyrBarCode) {
        this.columName = columName;
        this.ShelfNo = ShelfNo;
        this.BuildNo = BuildNo;
        this.FloorNo = FloorNo;
        this.RoomNo = RoomNo;
        this.BuildingName = BuildingName;
        this.FloorName = FloorName;
        this.RoomName = RoomName;
        this.Id = Id;
        this.tid = tid;
        this.shelfCode = shelfCode;
        this.shelfName = shelfName;
        this.layer = layer;
        this.bookCount = bookCount;
        this.firstBookID = firstBookID;
        this.firstBookName = firstBookName;
        this.firstBookLibCD = firstBookLibCD;
        this.bookIndex = bookIndex;
        this.pretendIndexNum = pretendIndexNum;
        this.libCD = libCD;
        this.szLyrBarCode = szLyrBarCode;
    }

    public static final Creator<ShelfBean> CREATOR = new Creator<ShelfBean>() {
        @Override
        public ShelfBean createFromParcel(Parcel source) {
            return new ShelfBean(source);
        }

        @Override
        public ShelfBean[] newArray(int size) {
            return new ShelfBean[size];
        }
    };
}
